
<!DOCTYPE HTML>
<html lang="" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>GitBook环境搭建 · GitBook</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.3">
        
        
        
    
    <link rel="stylesheet" href="gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-highlight/website.css">
                
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-search/search.css">
                
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-fontsettings/website.css">
                
            
        

    

    
        
    
        
    
        
    
        
    
        
    
        
    

        
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="Markdown/" />
    
    

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="Type to search" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
    
    

    

    
        
        
    
        <li class="chapter active" data-level="1.1" data-path="./">
            
                <a href="./">
            
                    
                    GitBook环境搭建
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="Markdown/">
            
                <a href="Markdown/">
            
                    
                    Markdown语法
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.2.1" data-path="Markdown/title.html">
            
                <a href="Markdown/title.html">
            
                    
                    标题
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.2" data-path="Markdown/font.html">
            
                <a href="Markdown/font.html">
            
                    
                    字体
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.3" data-path="Markdown/stage.html">
            
                <a href="Markdown/stage.html">
            
                    
                    段落
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.4" data-path="Markdown/block.html">
            
                <a href="Markdown/block.html">
            
                    
                    区块引用
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.5" data-path="Markdown/codeBlock.html">
            
                <a href="Markdown/codeBlock.html">
            
                    
                    代码区块
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.6" data-path="Markdown/list.html">
            
                <a href="Markdown/list.html">
            
                    
                    列表
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.7" data-path="Markdown/split.html">
            
                <a href="Markdown/split.html">
            
                    
                    分割线
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.8" data-path="Markdown/link.html">
            
                <a href="Markdown/link.html">
            
                    
                    超链接
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.9" data-path="Markdown/image.html">
            
                <a href="Markdown/image.html">
            
                    
                    图片
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.10" data-path="Markdown/backSlant.html">
            
                <a href="Markdown/backSlant.html">
            
                    
                    反斜杠
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.11" data-path="Markdown/mark.html">
            
                <a href="Markdown/mark.html">
            
                    
                    符号
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.12" data-path="Markdown/table.html">
            
                <a href="Markdown/table.html">
            
                    
                    表格
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.13" data-path="Markdown/flow.html">
            
                <a href="Markdown/flow.html">
            
                    
                    流程图
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.3" data-path="Log/">
            
                <a href="Log/">
            
                    
                    日志
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.3.1" data-path="Log/201903.html">
            
                <a href="Log/201903.html">
            
                    
                    2019年03月
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            Published with GitBook
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href="." >GitBook环境搭建</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <h1 id="gitbook&#x7B80;&#x4ECB;">GitBook&#x7B80;&#x4ECB;</h1>
<h2 id="&#x5B89;&#x88C5;">&#x5B89;&#x88C5;</h2>
<p>  gitbook&#x4F9D;&#x8D56;nodejs&#x73AF;&#x5883;&#xFF0C;&#x9700;&#x5148;&#x5B89;&#x88C5;nodejs&#xFF0C;cmd&#x6267;&#x884C;&#x4EE5;&#x4E0B;&#x547D;&#x4EE4;&#xFF1A;</p>
<p>  &#x4F7F;&#x7528;npm&#x6267;&#x884C;</p>
<pre><code>npm install -g gitbook-cli
</code></pre><p>  &#x4F7F;&#x7528;yarn&#x6267;&#x884C;</p>
<pre><code>yarn global add gitbook-cli
</code></pre><p>  mac &#x52A0;&#x4E0A; sudo &#x83B7;&#x53D6;&#x7BA1;&#x7406;&#x5458;&#x6743;&#x9650;</p>
<h2 id="&#x4F7F;&#x7528;">&#x4F7F;&#x7528;</h2>
<p>  <strong> 1&#x3001;&#x521D;&#x59CB;&#x5316; </strong></p>
<p>  &#x65B0;&#x5EFA;&#x4E00;&#x4E2A;mybook&#x6587;&#x4EF6;&#x5939;&#xFF0C;cd mybook &#x6267;&#x884C;&#x4EE5;&#x4E0B;&#x547D;&#x4EE4;&#xFF1A;</p>
<pre><code>gitbook init
</code></pre><p>  &#x6267;&#x884C;&#x5B8C;&#x540E;&#xFF0C;&#x4F60;&#x4F1A;&#x770B;&#x5230;&#x591A;&#x4E86;&#x4E24;&#x4E2A;&#x6587;&#x4EF6; &#x2014;&#x2014; README.md &#x548C; SUMMARY.md&#xFF0C;&#x5B83;&#x4EEC;&#x7684;&#x4F5C;&#x7528;&#x5982;&#x4E0B;&#xFF1A;</p>
<ul>
<li>README.md &#x2014;&#x2014; &#x4E66;&#x7C4D;&#x7684;&#x4ECB;&#x7ECD;&#x5199;&#x5728;&#x8FD9;&#x4E2A;&#x6587;&#x4EF6;&#x91CC;</li>
<li><p>SUMMARY.md &#x2014;&#x2014; &#x4E66;&#x7C4D;&#x7684;&#x76EE;&#x5F55;&#x7ED3;&#x6784;&#x5728;&#x8FD9;&#x91CC;&#x914D;&#x7F6E;</p>
<p>&#x7F16;&#x8F91; SUMMARY.md &#x6587;&#x4EF6;&#xFF0C;&#x5185;&#x5BB9;&#x4FEE;&#x6539;&#x4E3A;&#xFF1A;</p>
<pre><code>* [GitBook&#x73AF;&#x5883;&#x642D;&#x5EFA;](README.md)
* [Markdown&#x8BED;&#x6CD5;](Markdown/README.md)
    * [&#x6807;&#x9898;](Markdown/title.md)
    * [&#x5B57;&#x4F53;](Markdown/font.md)
    * [&#x6BB5;&#x843D;](Markdown/stage.md)
    * [&#x533A;&#x5757;&#x5F15;&#x7528;](Markdown/block.md)
    * [&#x4EE3;&#x7801;&#x533A;&#x5757;](Markdown/codeBlock.md)
    * [&#x5217;&#x8868;](Markdown/list.md)
    * [&#x5206;&#x5272;&#x7EBF;](Markdown/split.md)
    * [&#x94FE;&#x63A5;](Markdown/link.md)
    * [&#x56FE;&#x7247;](Markdown/image.md)
    * [&#x53CD;&#x659C;&#x6760;](Markdown/backSlant.md)
    * [&#x7B26;&#x53F7;](Markdown/mark.md)
    * [&#x8868;&#x683C;](Markdown/table.md)
    * [&#x6D41;&#x7A0B;&#x56FE;](Markdown/flow.md)
</code></pre></li>
</ul>
<p>&#x56DE;&#x5230;&#x547D;&#x4EE4;&#x884C;&#xFF0C;&#x5728; mybook &#x6587;&#x4EF6;&#x5939;&#x4E2D;&#x518D;&#x6B21;&#x6267;&#x884C; gitbook init &#x547D;&#x4EE4;</p>
<p>GitBook &#x4F1A;&#x67E5;&#x627E; SUMMARY.md &#x6587;&#x4EF6;&#x4E2D;&#x63CF;&#x8FF0;&#x7684;&#x76EE;&#x5F55;&#x548C;&#x6587;&#x4EF6;&#xFF0C;&#x5982;&#x679C;&#x6CA1;&#x6709;&#x5219;&#x4F1A;&#x5C06;&#x5176;&#x521B;&#x5EFA;&#x3002;</p>
<blockquote>
<p>*&#x6267;&#x884C; gitbook init &#x547D;&#x4EE4;&#xFF0C;&#x5DF2;&#x521B;&#x5EFA;&#x7684;&#x76EE;&#x5F55;&#x548C;&#x6587;&#x4EF6;&#x4E0D;&#x4F1A;&#x88AB;&#x5220;&#x9664;</p>
</blockquote>
<p> <strong> 2&#x3001;&#x9884;&#x89C8; </strong></p>
<p> &#x6267;&#x884C; </p>
<pre><code> gitbook serve
</code></pre><p>&#x6267;&#x884C;&#x547D;&#x4EE4;&#x540E;&#x4F1A;&#x5BF9; Markdown &#x683C;&#x5F0F;&#x7684;&#x6587;&#x6863;&#x8FDB;&#x884C;&#x8F6C;&#x6362;&#xFF0C;&#x9ED8;&#x8BA4;&#x8F6C;&#x6362;&#x4E3A; html &#x683C;&#x5F0F;</p>
<p>&#x6700;&#x540E;&#x63D0;&#x793A; Serving book on <a href="http://localhost:4000" target="_blank">http://localhost:4000</a></p>
<blockquote>
<p>&#x9884;&#x89C8;&#x8FC7;&#x7A0B;&#x4FEE;&#x6539; *.md &#x6587;&#x6863;&#x4F1A;&#x5B9E;&#x65F6;&#x751F;&#x6210;&#x5237;&#x65B0;&#x5185;&#x5BB9; </p>
<p>&#x9884;&#x89C8;&#x8FC7;&#x7A0B;&#x4FEE;&#x6539; SUMMARY.md &#x4E0D;&#x4F1A;&#x521B;&#x5EFA;&#x65B0;&#x6587;&#x4EF6;&#xFF0C;&#x82E5;&#x8981;&#x521B;&#x5EFA;&#x6267;&#x884C; gitbook init &#x547D;&#x4EE4;</p>
</blockquote>
<p>&#x6307;&#x5B9A;&#x7AEF;&#x53E3;&#x542F;&#x52A8;</p>
<pre><code>gitbook serve --port 8080
</code></pre><p> <strong> 3&#x3001;&#x6784;&#x5EFA; </strong></p>
<p>  &#x6267;&#x884C;&#x547D;&#x4EE4;</p>
<pre><code>  gitbook build 
</code></pre><p>  &#x6784;&#x5EFA;&#x4E66;&#x7C4D;&#xFF0C;&#x9ED8;&#x8BA4;&#x5C06;&#x751F;&#x6210;&#x7684;&#x9759;&#x6001;&#x7F51;&#x7AD9;&#x8F93;&#x51FA;&#x5230; _book &#x76EE;&#x5F55;</p>
<p>  build &#x547D;&#x4EE4;&#x53EF;&#x4EE5;&#x6307;&#x5B9A;&#x8DEF;&#x5F84;&#xFF1A;</p>
<pre><code>  gitbook build [&#x4E66;&#x7C4D;&#x8DEF;&#x5F84;] [&#x8F93;&#x51FA;&#x8DEF;&#x5F84;]
</code></pre><p>  &#x751F;&#x6210; PDF &#x683C;&#x5F0F;&#x7684;&#x7535;&#x5B50;&#x4E66;&#xFF1A;</p>
<pre><code>  gitbook pdf ./ ./mybook.pdf
</code></pre><p>  &#x751F;&#x6210; epub &#x683C;&#x5F0F;&#x7684;&#x7535;&#x5B50;&#x4E66;&#xFF1A;</p>
<pre><code>  gitbook epub ./ ./mybook.epub
</code></pre><p>  &#x751F;&#x6210; mobi &#x683C;&#x5F0F;&#x7684;&#x7535;&#x5B50;&#x4E66;&#xFF1A;</p>
<pre><code>  gitbook mobi ./ ./mybook.mobi
</code></pre>
                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                
                <a href="Markdown/" class="navigation navigation-next navigation-unique" aria-label="Next page: Markdown语法">
                    <i class="fa fa-angle-right"></i>
                </a>
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"GitBook环境搭建","level":"1.1","depth":1,"next":{"title":"Markdown语法","level":"1.2","depth":1,"path":"Markdown/README.md","ref":"Markdown/README.md","articles":[{"title":"标题","level":"1.2.1","depth":2,"path":"Markdown/title.md","ref":"Markdown/title.md","articles":[]},{"title":"字体","level":"1.2.2","depth":2,"path":"Markdown/font.md","ref":"Markdown/font.md","articles":[]},{"title":"段落","level":"1.2.3","depth":2,"path":"Markdown/stage.md","ref":"Markdown/stage.md","articles":[]},{"title":"区块引用","level":"1.2.4","depth":2,"path":"Markdown/block.md","ref":"Markdown/block.md","articles":[]},{"title":"代码区块","level":"1.2.5","depth":2,"path":"Markdown/codeBlock.md","ref":"Markdown/codeBlock.md","articles":[]},{"title":"列表","level":"1.2.6","depth":2,"path":"Markdown/list.md","ref":"Markdown/list.md","articles":[]},{"title":"分割线","level":"1.2.7","depth":2,"path":"Markdown/split.md","ref":"Markdown/split.md","articles":[]},{"title":"超链接","level":"1.2.8","depth":2,"path":"Markdown/link.md","ref":"Markdown/link.md","articles":[]},{"title":"图片","level":"1.2.9","depth":2,"path":"Markdown/image.md","ref":"Markdown/image.md","articles":[]},{"title":"反斜杠","level":"1.2.10","depth":2,"path":"Markdown/backSlant.md","ref":"Markdown/backSlant.md","articles":[]},{"title":"符号","level":"1.2.11","depth":2,"path":"Markdown/mark.md","ref":"Markdown/mark.md","articles":[]},{"title":"表格","level":"1.2.12","depth":2,"path":"Markdown/table.md","ref":"Markdown/table.md","articles":[]},{"title":"流程图","level":"1.2.13","depth":2,"path":"Markdown/flow.md","ref":"Markdown/flow.md","articles":[]}]},"dir":"ltr"},"config":{"gitbook":"*","theme":"default","variables":{},"plugins":["livereload"],"pluginsConfig":{"livereload":{},"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"}},"file":{"path":"README.md","mtime":"2019-03-04T06:31:38.867Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2019-03-04T11:59:09.105Z"},"basePath":".","book":{"language":""}});
        });
    </script>
</div>

        
    <script src="gitbook/gitbook.js"></script>
    <script src="gitbook/theme.js"></script>
    
        
        <script src="gitbook/gitbook-plugin-livereload/plugin.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-search/search-engine.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-search/search.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-lunr/lunr.min.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-lunr/search-lunr.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-sharing/buttons.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    

    </body>
</html>

